<div class="searchresults">
        <div class="yescontenttoprow">
            <p class="results"><?php echo $count; ?> 
                results</p>

            <div class="color-main" id="paginationalone">
                <?php $this->widget('CLinkPager', array('header' => '', 'pages' => $pages, "cssFile" => false)); ?>
            </div>


            <div class="searchsort">
                <select name="searchsortby" id="searchsortby"><option value="MyDefault" selected="selected">My Default</option>
                    <option value="1">Distance</option>
                    <option value="2">Activity</option>
                    <option value="3">New Members</option>
                    <option value="4">Members Online</option>
                </select>
                <p class="viewbylist lightgraytext">
                    Sort by:</p>
            </div>
            <div class="toprowfloatright">
                <div class="listpagelinksarea">
                    <p class="viewbylist lightgraytext">
                        View by:</p>
                    <div class="listpagelinksarea3 listpagelinksarea3off">
                        <p>
                            <a id="DisplayGalleryLink" href="javascript:;">Gallery</a></p>
                    </div>
                    <div class="listpagelinksarea1  listpagelinksarea1on">
                        <p>
                            <a id="DisplayListLink" href="javascript:;">List</a></p>
                    </div>
                </div>
            </div>
            <p class="clearfix">
                &nbsp;</p>
        </div>
        <?php
        foreach ($models as $model):
            // dump($model); die;
            ?>
            <div class="yescontentmiddlerow">

                <div class="profilerepeat ">
                    <div class="profilerepeatcol1large">
                        <div id="profileoverlayplace"> <?php //echo url()->createUrl('user/profile/viewprofile?profile', array('user_id'=>$model->user_id)); ?>
                        </div>
                        <a title="" href="<?php echo FRONT_SITE_URL;?>user/profile/viewprofile?profile=<?php echo $model->user_id; ?>">
                            <?php //dump($model->mUserPhotos->link_img); die; ?>
                            
                            <?php if ($model->userPhoto->link_img != null) { ?>
                                <img border="0" class="userpiclarge" src="<?php echo FRONT_SITE_URL ?>www/uploads/photos/thumbs/<?php echo 'thumb_' . $model->userPhoto->link_img; ?>">
                            <?php } ?>
                            <?php if ($model->userPhoto->link_img == null) { ?>
                                <img border="0" class="userpiclarge" src="<?php echo FRONT_SITE_URL ?>www/images/images1/noPhoto-1t.gif">
                            <?php } ?>
                        </a>
                    </div>
                    <div class="profilerepeatcol2large">
                        <div class="profilerepeatcol2row1">
                            <p>
                                <a href="<?php echo FRONT_SITE_URL;?>user/profile/viewprofile?profile=<?php echo $model->user_id; ?>"><?php echo $model->username; ?></a></p>
                            <a style="" fav-member-id="3C47D8E10B63C2DF" href="javascript:;">
                                <img border="0" title="Save as Favorite" alt="" src="<?php echo FRONT_SITE_URL ?>www/images/images1/favoriteicon.png">
                                <!--TODO: If in test and not favorite, show add to favoritest text-->
                                Save to Favorites
                            </a><a style="display:none;" unfav-member-id="3C47D8E10B63C2DF" href="javascript:;">
                                <img border="0" title="Saved as Favorite" alt="" src="<?php echo FRONT_SITE_URL ?>www/images/images1/favoritedicon.png">
                            </a>
                        </div>
                        <div class="profilerepeatcol2row2">
                            <p>
                                <?php
                                $birthDate = $model->profile->birthdate;
                                $dob = date("Y-m-d", strtotime($birthDate));

                                $dobObject = new DateTime($dob);
                                $nowObject = new DateTime();

                                $diff = $dobObject->diff($nowObject);

                                echo $diff->y;
                                ?>
                                | <?php echo $model->profile->state; ?>, <?php echo $model->profile->country; ?> | Last Activity: This Week</p>
                            <p>
                                &nbsp;|</p>
                            <p class="color-img">
                                &nbsp;&nbsp;NEW MEMBER&nbsp;&nbsp;</p>
                        </div>
                        <div class="profilerepeatcol2row3">
                            <p>
                                <a href="<?php echo FRONT_SITE_URL;?>user/profile/viewprofile?profile=<?php echo $model->user_id; ?>">View Full Profile</a></p>
                        </div>
                    </div>
                    <p class="clearfix">
                        &nbsp;</p>
                </div>

            <?php endforeach; ?>




        </div>
        <div class="bottomrow">
            <div class="color-main" id="paginationsearch">
                <!-- <div id="paginationsearchleft">
                     <a title="Previous" class="button_style buttonunavailable" href="javascript:;">Previous</a>
                 </div>-->
                <!--<div id="paginationsearchcenter">
                    <a href="javascript:;">
                        <img border="0" class="arrowunavailable" alt="" src="<?php echo FRONT_SITE_URL ?>www/images/images1/leftarrow.png"></a>
                    <span class="paginationon">1</span>
                    <a page-index="2" href="javascript:;">2</a>
                    ...
                    <a page-index="41" href="javascript:;">41</a>
                    <a page-index="2" href="javascript:;">
                        <img border="0" alt="" src="<?php echo FRONT_SITE_URL ?>www/images/images1/rightarrow.png"></a>
                </div>-->

                <div class="color-main" id="paginationalone">
                    <?php $this->widget('CLinkPager', array('header' => '', 'pages' => $pages, "cssFile" => false)); ?>
                </div>

                <!--<div id="paginationsearchright">
                    <a title="Next" class="button_style" page-index="2" href="javascript:;">
                        Next</a>
                </div>-->
            </div>
        </div>
    </div>
<script>
    $(document).ready(function(){
       loadEvent(); 
    });
    </script>